package book;

/**
 * @Author 12629
 * @Description： 书架
 */
public class BookList {

    private Book[] books; //存放书籍
    private static final int DEFAULT_SIZE = 10;

    private int usedSize; // 有效书籍的个数

    //private int xxxx;

    public BookList() {
        this.books = new Book[DEFAULT_SIZE];
        //预先存3本书
        this.books[0] = new Book("三国演义","罗贯中",19,"武侠");
        this.books[1] = new Book("西游记","吴承恩",20,"神话");
        this.books[2] = new Book("红楼梦","曹雪芹",15,"小说");

        this.usedSize = 3;
    }

    public Book[] getBooks() {
        return books;
    }

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }

    //.....还有待补充的

    public Book getBook(int pos) {
        return books[pos];
    }

    public void setBooks(int pos,Book book) {
        books[pos] = book;
    }

}

